//
//  WQPhotosView.swift
//  sanwuWeibo
//
//  Created by 王先强 on 15/12/19.
//  Copyright © 2015年 王先强. All rights reserved.
//

import UIKit

class WQPhotosView: UICollectionView {


    init(){
        super.init(frame: CGRectZero, collectionViewLayout: WQPhotosViewLayout())
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

}

class WQPhotosViewLayout: UICollectionViewFlowLayout {
    override func prepareLayout() {
        super.prepareLayout()
        itemSize = collectionView!.bounds.size
        minimumInteritemSpacing = 0
        minimumLineSpacing = 0
        scrollDirection = .Horizontal
        collectionView?.bounces = false
        collectionView?.pagingEnabled = true
        collectionView?.showsHorizontalScrollIndicator = false
        collectionView?.registerClass(WQPhotosViewCell.self, forCellWithReuseIdentifier: WQPhotosViewCellID)
    }
}